package com.trkj.dao.jpa;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojos.LmbConsumable;

public interface LmbCousumableDAO extends CrudRepository<LmbConsumable, String> {
	@Query("select c.cName from  LmbConsumable c where c.cId = ?1")
    public String findName(String s);
	
	@Query("select max(c.cId) from LmbConsumable c where c.cId like ?1%")
    public String findMaxID(String a);
	
	@Query("select s from LmbConsumable s order by s.cId desc")
	public List<LmbConsumable> findLmbConsumableByPage(Pageable pageable);
	
	@Query("select count(*) from LmbConsumable s ")
	public long findCountLmbConsumable();
	
	@Query("select s from LmbConsumable s where s.cName like ?1%")
	public List<LmbConsumable> findLmbConsumableByCname(Pageable pageable,String cname);
	
	@Query("select count(*) from LmbConsumable s where s.cName like ?1%")
	public long findCountLmbConsumableByCname(String cname);
		
}
